Sentiments and Topics in South African SONA Speeches

Abstract


Introduction


The field of Natural Language Processing (NLP) is faceted by techniques tailored for theme tracking and opinion mining which merge part of text analysis. Though, of particular prominence, is the extraction of latent thematic patterns and the establishment of the extent of emotionality expressed in political-based texts.

Given such political context, it is of specific interest to analyse the annual State of the Nation Address (SONA) speeches delivered by six different South African presidents (F.W. de Klerk, N.R. Mandela, T.M. Mbeki, K.P. Motlanthe, J.G. Zuma, and M.C. Ramaphosa) ranging over twenty-nine years (from 1994 to 2023). This analysis, descriptive and data-driven in nature, endeavours to examine the content of the SONA speeches in terms of themes via topic modelling (TM) and emotions via sentiment analysis (SentA). Applying a double-bifurcated approach, SentA will be executed within a macro and micro context both at the text (all-presidents versus by-president SONA speeches, respectively) and token (sentences versus words, respectively) level, as shown in Figure 1. This underlying framework is also assumed for TM, with the exceptions of only employing it within a macro-context at text level and a micro-context at the token level, as seen in Figure 2.

Figure 1: Illustration of how sentA will be implemented within a different-scales-within-different-levels framework for the presidential-SONA-speeech text analysis.

Figure 2: Depiction of how TM will be done using a similar approach to sentA, though tokens will only be defined in terms of words (and not also as sentences) at a text level of all SONA speeches (so disregarding the micro-president context).

Through such a multi-layered lens, the identification of any trends, both in terms of topics and sentiments, over time at both a large (presidents as a collective) as well as at a small (each president as an individual) scale is attainable. This explicates not only an aggregated perspective of the general political discourse prevailing within South Africa (SA), but also a more niche outlook of the specific rhetoric employed by each of the country’s serving presidents during different date periods.

To achieve all of the above-mentioned, it is first relevant to revise foundational terms and review related literature in context of politics and NLP. All pertinent pre-processing of the political text data is then considered, followed by a discussion delving into the details of each SentA and TM approach applied. Specifically, two different lexicons are leveraged to describe sentiments, whilst five different topic models are tackled to uncover themes within South-African-presidents’ SONA speeches. Ensuing the implementation of these methodologies, the results thereof are detailed in terms insights and interpretations. Thereafter, an overall evaluation of the techniques in terms of efficacy and inadequacy is overviewed. Finally, focal findings are highlighted and potential improvements as part of future research are recommended.

Literature Review


SONA

SONA, a pivotal event in the political programme of Parliament, serves as a presidential summary for the South African public. Specifically, the country’s current domestic affairs and international relations are reflected upon, past governmental work is perused, and future plans in terms of policies and civil projects are proposed. Through this address, accountability on the part of government is re-instilled and transparency with the public is re-affirmed on an annual basis, either once (non-election year) or twice (pre-and-post election) (Minister Faith Muthambi 2017). The text analysis of such SONA speeches, via the implementation of TM and SentA, has been previously done for Philippine presidents (Miranda and Bringula 2021). Though, it is now of interest to extend such an application to another country, SA.

Topic modelling (TM)

TM, an unsupervised learning approach, implicates the identification of underlying abstract themes in some body of text, in the absence of pre-specified labels (Cho 2019). In general, there are two topic-model assumptions: each document comprises of a mixture of topics and each topic consists of a collection of words (Zhang 2018). Different types of topic models exist, each with varying complexity in terms of the way in which topics are generated. The simplest one, Latent Semantic Analysis (LSA), has previously been implemented to discover patterns of lexical cohesion in political speech, specifically that of the former Prime Minister of the United Kingdom, Margaret Thatcher (Klebanov, Diermeier, and Beigman 2008). Improving on LSA methodology, Probabilistic LSA (pLSA) has been implemented in healthcare (Zhu 2014) and educational (Ming et al. 2014) contexts, albeit no application thereof in political science was found. A further sophisticated model, Latent Dirichlet Allocation (LDA), has been used to determine trending topics in news on governmental YouTube channels (Subhan et al. 2023).

Sentiment analysis (SentA)

SentA involves deciphering the intent of words to infer certain emotional dimensions labelled either in polarized (negative/positive) or higher-dimensional terms (niche feelings like joy/sadness). Various unigram lexicons have been derived to such extents. For example, the R-based \(\texttt{nrc}\) lexicon dichotomously classifies words with yes/no labels in categories such as positive, negative, anticipation, anger, and so forth. In contrast, the Python-based \(\texttt{TextBlob}\) lexicon processes textual data in the form of a tuple where a polarity score (ranges between -1 and +1 which relates to negative and positive sentiment, respectively) and a subjectivity score (ranges between 0 and 1 which refers to being very objective or very subjective, respectively) is produced. Using such pre-defined lexicons has been previously utilized to analyze political communication, specifically in terms of campaign polarization, via SentA (Haselmayer and Jenny 2017).

Data


Tokenization

The process of tokenization entails breaking up given text into units, referred to as tokens (or terms), which are meaningful for analysis (Zhang 2018). In this case, these tokens take on different structures, based on either a macro-context (i.e., sentences) or micro-context (i.e., words). At both scales, the way in which these tokens are valued will be varied. The value will either be defined by a bag-of-words (BoW) or term-frequency, inverse-document-frequency (tf-idf) approach. The former way implicates accounting for the number of occurrences of some token in some document. On the other hand, the latter way not only regards the frequency of some token, but also the significance thereof. Thus, tf-idf involves the assignment of some weight to each token in a document which in turn reflects its importance relative to the entire collection of documents (corpus). It then follows that the tf-idf value of a token t in a document d within a corpus D is calculated as the product of two constituents. The first being tf(t,d) defined as the quotient of the frequency of token t in document d and the total number of tokens in document d, whereas the second is idf(t, D) denoted by the quotient of the natural logarithm of the total number of documents in corpus D and the number of documents containing the token t (Silge and Robinson 2017). N

Number of topics

In order to determine the optimal number of topics, a coherence score is calculated. This metric measures the ability of a topic model to distinguish well between topics that are semantically interpretable by humans and are not simply statistical-inference artifacts. Hence, the number of topics as well as any other topic-model hyperparameters (like \(\alpha\) and \(\beta\) for LDA) are tuned to values that yield the maximum coherence score, allowing for the most understandable themes.

Methods


Topic modelling

Latent Semantic Analysis (LSA)

Figure 3: Schematic representation of LSA outlining the factorization of the DTM matrix.

LSA (Deerwester et al. 1990) is a non-probabilistic, non-generative model where a form of matrix factorization is utilized to uncover few latent topics, capturing meaningful relationships among documents/tokens. As depicted in Figure 3, in the first step, a document-term matrix DTM is generated from the raw text data by tokenizing d documents into w words (or sentences), forming the columns and rows respectively. Each row-column entry is either valued via the BoW or tf-idf approach. This DTM-matrix, which is often sparse and high-dimensional, is then decomposed via a dimensionality-reduction-technique, namely truncated Singular Value Decomposition (SVD). Consequently, in the second step the DTM-matrix becomes the product of three matrices: the topic-word matrix \(A_{t*}\) (for the tokens), the topic-prevalence matrix \(B_{t*}\) (for the latent semantic factors), and the transposed document-topic matrix \(C^{T}_{t*}\) (for the document). Here, t*, the optimal number of topics, is a hyperparameter which is refined at a value (via the coherence-measure approach) that retains the most significant dimensions in the transformed space. In the final step, the text data is then encoded using this top-topic number.

Given LSA only implicates a DTM-matrix, the implementation thereof is generally efficient. Though, with the involvement of truncated SVD, some computational intensity and a lack of quick updates with new, incoming text-data can arise. Additional LSA drawbacks include: the lack of interpretability, the underlying linear-model framework (which results in poor performance on text-data with non-linear dependencies), and the underlying Gaussian assumption for tokens in documents (which may not be an appropriate distribution).

Probabilistic Latent Semantic Analysis (pLSA)

Figure 4: Schematic representation of pLSA, where the different-shade-of-blue colours highlight similarities shared with LSA-related matrices shown in Figure 3.

Instead of implementing truncated SVD, pLSA (Hofmann 1999) rather utilizes a generative, probabilistic model. Within this framework, a document d is first selected with probability P(d). Then given this, a latent topic t is present in this selected document d and so chosen with probability of P(t|d). Finally, given this chosen topic t, a word w (or sentence) is generated from it with probability P(w|t), as shown in Figure 4. It is noted that the values of P(d) is determined directly from the corpus D which is defined in terms of a DTM matrix. In contrast, the probabilities P(t|d) and P(w|t) are parameters modelled as multinomial distributions and iteratively updated via the Expectation-Maximization (EM) algorithm. Direct parallelism between LSA and pLSA can be drawn via the methods’ parameterization, as conveyed via matching colours of the topic-word matrix and P(w|t), the document-topic matrix and P(d|t) as well as the topic-prevalence matrix and P(t) displayed in Figure 3 and Figure 4, respectively.

Despite pLSA implicitly addressing LSA-related disadvantages, this method still involves two main drawbacks. There is no probability model for the document-topic probabilities P(t|d), resulting in the inability to assign topic mixtures to new, unseen documents not trained on. Model parameters also then increase linearly with the number of documents added, making this method more susceptible to overfitting.

Latent Dirichlet Allocation

Figure 5: Schematic representation of LDA where the dark-blue-shaded block represents observed words.

LDA is another generative, probabilistic model which can be deemed as a hierarchical Bayesian version of pLSA. Via explicitly defining a generative model for the document-topic probabilities, both the above-mentioned pitfalls of pLSA are improved upon. The number of parameters to estimate drastically decrease and the ability to apply and generalize to new, unseen documents is attainable. As presented in Figure 5, the initial steps first involve randomly sampling a document-topic probability distribution \(\theta\) from a Dirichlet (Dir) distribution \(\eta\), followed by randomly sampling a topic-word probability distribution \(\phi\) from another Dirichlet distribution \(\tau\). From the \(\theta\) distribution, a topic t is selected by drawing from a multinomial (Mult) distribution (third step) and from the \(\phi\) distribution given said topic t, a word w (or sentences) is sampled from another multinomial distribution (fourth step). The associated LDA-parameters are then estimated via a variational expectation maximization algorithm or collapsed Gibbs sampling.

Correlated Topic Model (CTM)

Figure 6: Schematic representation of CTM where the dark-blue-shaded block represents observed words, whilst the light-grey colour outlines the distinctions from the LDA topic model presented in Figure 5.

Following closely to LDA, the CTM (Lafferty and Blei 2005) additionally allows for the ability to model the presence of any correlated topics. Such topic correlations are introduced via the inclusion of the multivariate normal (MultNorm) distribution with t length-vector of means \(\mu\) and t \(\times\) t covariance matrix \(\Sigma\) where the resulting values are then mapped into probabilities by passing through a logistic (log) transformation. Comparing Figure 5 and Figure 6, the nuance between LDA and CTM is highlighted using a light-grey colour, where the discrepancy in the models come about from replacing the Dirichlet distribution (which involves the implicit assumption of independence across topics) with the logit-normal distribution (which now explicitly enables for topic dependency via a covariance structure) for generating document-topic probabilities. The other generative processes previously outlined for LDA is retained and repeated for CTM. Given this additional model complexity, the more convoluted mean-field variational inference algorithm is employed for CTM-parameter estimation which necessitates many iterations for optimization purposes. CTM is consequently computationally more expensive than LDA. Though, this snag is far outweighed by the procurement of richer topics with overt relationships acknowledged between these.

Author Topic Model (ATM)

Figure 7: Schematic representation of ATM where the dark-blue-shaded blocks represents observed words and authors, whilst the light-grey colour highlights the differences compared to the LDA topic model presented in Figure 5.

ATM (Rosen-Zvi et al. 2012) extends LDA via the inclusion of authorship information with topics. Again, inspecting Figure 5 and Figure 7, the slight discrepancies between these two models are accentuated with the light-grey colour. Here, for each word w in the document d an author a is sampled uniformly (Uni) at random. Each author is associated with a distribution over topics (\(\Psi\)) sampled from a Dirichlet prior \(\alpha\). The resultant mixture weights corresponding to the chosen author are used to select a topic t, then a word w (or sentence) is generated according to the topic-word distribution \(\phi\) (drawn from another Dirichlet prior \(\beta\)) corresponding to that said chosen topic t. Therefore, through the estimation of the \(\psi\) and \(\phi\) parameters, not only is information obtained about which topics authors generally relate to, but also a representation of these document contents in terms of these topics, respectively.

Sentiment analysis

AFINN

The R-based \(\texttt{AFINN}\) lexicon scores words across a range spanning from the value of -5 to +5. Intuitively, words scored closer to the lower-boundary value relate to more negative sentiment, and in contrast higher positive sentiment is revealed if rather closer to the upper-boundary value (Silge and Robinson 2017).

Bing

Unlike \(\texttt{AFINN}\) , the R-based \(\texttt{bing}\) lexicon does not provide sentiments via some scoring system. Instead, it simply assigns a binary label of a word being interpreted as either positive or negative (Silge and Robinson 2017).

Exploratory Data Analysis


Figure 8: Most frequent words used across all SONA speeches, irrespective of president.

From Figure 8, it is evident that the word “government” is mainly referenced to across all SONA speeches. This word dominance draws upon how the importance of this authority body, which is integral to the governance of SA, is emphasized. The frequent usage of the words “people” and “public” indicates a sense of inclusivity where the idea of togetherness is implicitly suggested. Other words, such as “development” and “new”, are indicative of ideas of growth and renewal. Lastly, a sense of security and safety is provided with the recurring use of the word “ensure”.

(a) de Klerk

(b) Mandela

(c) Mbeki

(d) Motlanthe

(e) Zuma

(f) Ramaphosa

Figure 9: Most frequent words used in SONA speeches, faceted by president.

After faceting the most frequent words by president, as displayed in Figure 9, there are some slight nuances noted. For instance, former president de Klerk used words which were emblematic of the political paradigm shift that occurred during the time of his term. Words such as “transitional”, “constitutional”, and “constitution” reflects the country’s progression from an exclusive, segregated to a more inclusive, democratic state. This political and legal reform directed towards achieving societal equality is further underscored by the words, “parties”, “party”, and “election”. The pivotal role of proper partnerships being formed, which would have further aided in maintaining this change, is foregrounded with the word “alliance”.

Similarly, this idea of unity has also been foregrounded in the other five presidents’ speeches with the commonly shared word “people”. Though, unlike de Klerk, the other former presidents (Mandela, Mbeki, Motlanthe, Zuma) and current president (Ramaphosa), seem to similarly place more focus on the explicit communication of policies and vision (“development” and “work”) and the establishment of a sense of responsibility and accountability on their part as president (“government” and “ensure”). Some minor distinctions between these aforementioned presidents can be made. Mandela, Mbeki, and Motlanthe, for example, seemed to draw more attention to “society” or “social” progress, whilst Zuma and Ramaphosa appeared to place more prominence on “economic” progress.

Results


Sentiment Analysis

(a) \(\texttt{AFINN}\): All speeches

(b) \(\texttt{bing}\): All speeches

Figure 10: Overall sentiment score for SONA speeches across time (segmented by presidential terms), compared for two different lexicons.

Comparing Figure 10 (a) and Figure 10 (b), it is evident that there is no obvious, overt difference in the computed net sentiment scores, which are overall positive, across time and presidents for the two different lexicons. Any slight variation between \(\texttt{AFINN}\) and \(\texttt{bing}\) is most likely attributed to the lexicons’ varying scales (+5/-5 versus +1/-1, respectively). Hence, any sentiment derived from the former lexicon might be slightly more exaggerated in nature compared to the latter lexicon. This is noted when checking the \(y\)-axes range of the sentiment scores, which reach a maximum of 600 for the \(\texttt{AFINN}\) lexicon and only 300 for the \(\texttt{bing}\) lexicon.

Across both lexicons, from de Klerk to Mbeki’s presidential terms, positive sentiment seems to steadily rise. Though, after a peak of high, positive sentiment scores from Mbeki’s SONA speeches, there is a slight decline in this overall positivity. This is especially present throughout Zuma’s presidential term.

(a) \(\texttt{AFINN}\): de Klerk speeches

(b) \(\texttt{bing}\): de Klerk speeches

(c) \(\texttt{AFINN}\): Mandela speeches

(d) \(\texttt{bing}\): Mandela speeches

(e) \(\texttt{AFINN}\): Mbeki speeches

(f) \(\texttt{bing}\): Mbeki speeches

(g) \(\texttt{AFINN}\): Motlanthe speeches

(h) \(\texttt{bing}\): Motlanthe speeches

(i) \(\texttt{AFINN}\): Zuma speeches

(j) \(\texttt{bing}\): Zuma speeches

(k) \(\texttt{AFINN}\): Ramaphosa speeches

(l) \(\texttt{bing}\): Ramaphosa speeches

Figure 11: Trajectory of sentiment score through SONA-speech sentences stratified by president, comparing across two different lexicons.

From inspecting Figure 11 , it is apparent that the relative trajectory of underlying emotion is generally similar for each president. The dips and troughs in sentiment prevalent for both \(\texttt{bing}\) and \(\texttt{AFINN}\) lexicons occur at approximately the same sentences in the respective presidents’ speeches. Though, there is some stark contrast found between the two lexicons when comparing for Zuma’s speeches. For this president, the negative falls and positive rises are more exaggerated for the \(\texttt{AFINN}\) compared to the \(\texttt{bing}\) lexicon. Additionally, the sentiment pattern of Mbeki’s speeches again seems more skewed to the positive side, with more frequent extreme rises to high sentiment score values across sentences. It is also again seen that more negative sentiment is expressed in Zuma’s speeches, give the more dominant dips. For Ramaphosa, there appears to be more of a balance between positive-and-negative sentiment. There are no extreme, outlying rises/falls, rather a more consistent sawtooth-like pattern is prominent.

(a) \(\texttt{AFINN}\): All speeches

(b) \(\texttt{bing}\): All speeches

Figure 12: Words which contribute to the positive and negative sentiment across all SONA speeches.

Similarly with the general sentiment-score trajectories, there are more overlaps between the two lexicons when comparing the specific words which contribute to the positive and negative sentiments, as displayed in Figure 12. The same seven (out of the top ten) words commonly contribute to negative sentiment (“corruption”, “crime”, “violence”), in addition to positive sentiment (“improve”, “support”, “progress”) across both lexicons. Albeit, the extent of these aforementioned words’ contributions to the respective sentiments do slightly vary in amounts. Some unique, independent words also add to the negative sentiment for the \(\texttt{AFINN}\) lexicon (“problems”, “unemployment”) and \(\texttt{bing}\) lexicon (“issues”). Likewise, there are distinctive words for this former lexicon (“growth”, “ensure”, “great”) and latter lexicon (“well”) attributed to positive sentiment.

(a) \(\texttt{AFINN}\): de Klerk speeches

(b) \(\texttt{bing}\): de Klerk speeches

(c) \(\texttt{AFINN}\): Mandela speeches

(d) \(\texttt{bing}\): Mandela speeches

(e) \(\texttt{AFINN}\): Mbeki speeches

(f) \(\texttt{bing}\): Mbeki speeches

(g) \(\texttt{AFINN}\): Motlanthe speeches

(h) \(\texttt{bing}\): Motlanthe speeches

(i) \(\texttt{AFINN}\): Zuma speeches

(j) \(\texttt{bing}\): Zuma speeches

(k) \(\texttt{AFINN}\): Ramaphosa speeches

(l) \(\texttt{bing}\): Ramaphosa speeches

Figure 13: Words which contribute to the positive and negative sentiment for each specific presidents’ SONA speech/speeches.

After faceting Figure 12 by president, as presented in the sub-plots of Figure 13, essentially no variability is indicated in terms of uniqueness and the contribution magnitude thereof. For both lexicons, the same set of words add the same amount to each sentiment. Furthermore, commonalities between words contributing to the sentiments is evident between the five presidents after de Klerk. Negative-sentiment words like “unconstitutional”, “deprive”, “discrimination”, and “boycott” and positive-sentiment words such as “proud”, “succeeded”, and “peaceful” only features in de Klerk’s speech. All of these aforementioned words seem to directly relate to the change in political context during de Klerk’s term. Whilst, the words prevailing in the other five presidents’ speeches appear to foreground the continuation of this changed political climate with positive-sentiment words like “improve”, “better”, “freedom” and “peace”. Additionally, the shared negative-sentiment words like “crime”, “corruption” and “poverty” foreground the commonality of perpetuating problems that became pronounced throughout all presidential tenures after de Klerk.

Topic modelling Results

Latent Semantic Analysis (LSA)

In the micro-context (i.e., word tokenization) of LSA implementation, the maximum coherence score of approximately -1.5 seen in Figure 14 indicates that three topics are optimal when utilizing the tf-idf approach. In contrast, there is no discernible difference in the coherence scores across a range of topic numbers when instead using the BoW approach. Hence, for comparative purposes, three topics are also chosen as best in this instance.

Figure 14: Coherence plot for LSA where SONA speeches were tokenized by words.

Considering Figure 15, a different overarching focus seems to come to the fore contingent on whether the BoW or tf-idf approach is examined. With reference to the BoW-related corpus, the broad scope of the three topics appears associated to national frameworks and the future thereof. More particularly, the first topic labelled as governance alludes to processes (“work”, “development”) established by institutions (“government”) which direct communities (“public”, “people”). Words like “infrastructure”, “investment” and “energy” seem to indicate structural resources, which encompasses the second topic. The third topic, sustainability, is more related to the prospective of long-term (“years”) endurance (“continue”) across these governmental processes and resources.

On the other hand, with respect to the tf-idf-related corpus, the three topics now instead appear concentrated on current issues. The first topic centers on a sole problem, particularly that of common (“compatriots”) “pandemic” preparedness (“plan”). Whereas, the second topic broadens to other additional issues contextual to the country. Hence, in this case, the challenges range from energy (“eskom”) problems (“loadshedding”) to the “covid” “pandemic” to the government’s corruption (state “capture”). Most words contained in the third topic all already feature in topic one or two already. Given this lack of unique distinction, topic three is said to simply be a synthesis of the two, aforementioned topics.

(a) BoW: Topic 1 ~ governance

(b) tf-idf: Topic 1 ~ pandemic preparedness

(c) BoW: Topic 2 ~ structural resources

(d) tf-idf: Topic 2 ~ contemporary challenges

(e) BoW: Topic 3 ~ sustainability

(f) tf-idf: Topic 3 ~ an amalgamation

Figure 15: Topic-by-word plots for BoW (left) and tf-idf (right) approach for LSA implementation.

Unlike within the micro-context, LSA now applied in the maro-context (i.e., sentence tokenization) indicates more variability in the choice of the optimal topic number for both BoW and tf-idf approaches. Due to the excessive jumps between high and low coherence scores across the topic amounts seen in Figure 16, it is opted to choose the lowest best number. This choice aims to limit potential theme-overlapping (i.e., many common words shared across topics) and allow for more conciseness.

Figure 16: Coherence plot for LSA where SONA speeches were tokenized by sentences.

Given Figure 17, more of an overlap in topic scope across both corpus types is seen for the sentence-tokenized speeches. For instance, the second topic for the BoW-related corpus and the first topic for the tf-idf-related corpus are both labelled as governance, given the commonly shared words (“government”, “people”, “work” and “development”). The first topic for this former-mentioned corpus accounts for the internal structures (“leaders”, “assembly”, “president”, “members”) related to governance. Whilst, the second topic of the tf-idf-related corpus is very distinguishable with the dominant weighting of the word “thank”, connotated with a sense of gratitude. This topic also refers to some reformation indicators like “opportunity” and “growth”.

(a) BoW: Topic 1 ~ governmental structures

(b) tf-idf: Topic 1 ~ governance

(c) BoW: Topic 2 ~ governance

(d) tf-idf: Topic 2 ~ reformation and gratitude

Figure 17: SONA speeches tokenized by sentences for BoW (left) and tf-idf (right) approach for LSA implementation.

pLSA

As previously found with the implementation of LSA, there is essentially no variability in the coherence scores when utilizing the BoW approach for the word-tokenized application of pLSA. Though, like with LSA, there are fluctuating changes in the coherence scores across topic numbers when considering the tf-idf approach. Again, it is opted to take the minimum-best (based on tf-idf) number of three topics for both approaches which

Figure 18: Coherence plot for pLSA where SONA speeches were tokenized by words.

(a) BoW: Topic 1

(b) tf-idf: Topic 1

(c) BoW: Topic 2

(d) tf-idf: Topic 2

(e) BoW: Topic 3

(f) tf-idf: Topic 3

(g) BoW: Topic 4

(h) tf-idf: Topic 4

(i) BoW: Topic 5

(j) tf-idf: Topic 5

Figure 19: Topic plots for pLSA tokenized by words and executed within a BoW (left) and tf-idf (right) framework.

Figure 20: Coherence plot for pLSA where SONA speeches were tokenized by sentences.

(a) BoW: Topic 1

(b) tf-idf: Topic 1

(c) BoW: Topic 2

(d) tf-idf: Topic 2

(e) BoW: Topic 3

(f) tf-idf: Topic 3

(g) BoW: Topic 4

(h) tf-idf: Topic 4

Figure 21: Topic plots for pLSA using sentences as tokens and applied within a BoW (left) and tf-idf (right) framework.

LDA

(a) Words

(b) Sentences

Figure 22: Contour plots visualizing variation in coherence scores tuned across range of different \(\alpha\) and \(\beta\) hyperparameter values.

Table 1: Coherence scores obtained from a hyperparameter-combination grid search for implementation of LDA on SONA speeches tokenized by words.
Corpus Topics Alpha Beta Coherence
BoW 9 0.60 0.50 -0.42
BoW 9 0.60 0.10 -0.42
BoW 9 0.60 0.70 -0.42
BoW 9 0.60 0.90 -0.42
BoW 9 0.60 0.30 -0.42
tf-idf 7 0.20 0.90 -4.25
tf-idf 7 0.20 0.10 -4.25
tf-idf 7 0.20 0.30 -4.25
tf-idf 7 0.20 0.50 -4.25
tf-idf 7 0.20 0.70 -4.25
Table 2: Coherence scores obtained from a hyperparameter-combination grid search for implementation of LDA on SONA speeches tokenized by sentences.
Corpus Topics Alpha Beta Coherence
BoW 2 0.90 0.90 -18.98
BoW 2 0.80 0.50 -18.98
BoW 2 0.70 0.10 -18.98
BoW 2 0.70 0.30 -18.98
BoW 2 0.70 0.50 -18.98
tf-idf 2 0.40 0.10 -20.56
tf-idf 2 0.40 0.30 -20.56
tf-idf 2 0.40 0.50 -20.56
tf-idf 2 0.40 0.70 -20.56
tf-idf 2 0.40 0.90 -20.56

pyLDAvis for Words

pyLDAvis for Sentences

CTM

(a) Words ~ economy

(b) Sentences ~ economy

Figure 23: Coherence plots for CTM across different tokens (words or sentences) implemented within BoW approach.

(a) Sentences: Topic 1 ~ economy

(b) Words: Topic 1 ~ economy

(c) Sentences: Topic 2 ~ economic and structural advancement

(d) Words: Topic 2 ~ societal collectives

(e) Sentences: Topic 3 ~ social collectives

Figure 24: Topic plots where either sentences (left) or words (right) were used as tokens for CTM application.

ATM (Author-Topic Model)

(a) Words

(b) Sentences

Figure 25: Coherence plots for ATM across different tokens (words or sentences) implemented within BoW approach.

(a) Sentences: Topic 1 ~ social cohesion

(b) Words: Topic 1 ~ diplomatic strategy

(c) Sentences: Topic 2 ~ prospective plans

(d) Words: Topic 2 ~ general strategic vision

(e) Sentences: Topic 3 ~ esteem within governmental structures

Figure 26: Topic plots where either sentences (left) or words (right) were used as tokens for ATM application.

Table 3: ATM topics for each president.
President Document IDs Word-Based Topics Sentence-Based Topics
Mandela 4, 16, 0, 23, 31, 21, 15 Diplomatic strategy (0.52); General strategic vision (0.48) Social cohesion (1.00)
Ramaphosa 7, 26, 3, 24, 8, 1, 35 Diplomatic strategy (0.30); General strategic vision (0.70) Social cohesion (0.66); Esteem within governmental structures (0.34)
Mbeki 9, 14, 22, 34, 32, 28, 29, 2, 12, 25 Diplomatic strategy (0.33); General strategic vision (0.67) Social cohesion (1.00)
Zuma 13, 5, 6, 20, 19, 30, 27, 33, 11, 10 Diplomatic strategy (0.47); General strategic vision (0.53) Social cohesion (1.00)
deKlerk 17 Diplomatic strategy (0.56); General strategic vision (0.44) Social cohesion (0.02); Esteem within governmental structures (0.98)
Motlanthe 18 Diplomatic strategy (0.55); General strategic vision (0.45) Social cohesion (0.17); Prospective plans (0.83)

References

Cho, Hae-Wol. 2019. “Topic Modeling.” Osong Public Health and Research Perspectives 10 (June): 115–16. https://doi.org/10.24171/j.phrp.2019.10.3.01.
Deerwester, Scott, Susan T. Dumais, George W. Furnas, Thomas K. Landauer, and Richard Harshman. 1990. “Indexing by Latent Semantic Analysis.” Journal of the American Society for Information Science 41 (6): 391–407. https://doi.org/https://doi.org/10.1002/(SICI)1097-4571(199009)41:6<391::AID-ASI1>3.0.CO;2-9.
Haselmayer, Martin, and Marcelo Jenny. 2017. “Sentiment Analysis of Political Communication: Combining a Dictionary Approach with Crowdcoding.” Quality and Quantity 51 (November): 2623–46. https://doi.org/10.1007/s11135-016-0412-4.
Hofmann, Thomas. 1999. “Probabilistic Latent Semantic Indexing.” In Proceedings of the 22nd Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, 50–57. SIGIR ’99. New York, NY, USA: Association for Computing Machinery. https://doi.org/10.1145/312624.312649.
Klebanov, Beata Beigman, Daniel Diermeier, and Eyal Beigman. 2008. “Lexical Cohesion Analysis of Political Speech.” Political Analysis 16 (4): 447–63. http://www.jstor.org/stable/25791949.
Lafferty, John, and David Blei. 2005. “Correlated Topic Models.” In Advances in Neural Information Processing Systems, edited by Y. Weiss, B. Schölkopf, and J. Platt. Vol. 18. MIT Press. https://proceedings.neurips.cc/paper_files/paper/2005/file/9e82757e9a1c12cb710ad680db11f6f1-Paper.pdf.
Ming, Ding, Dong Bin, Yan Yonghong, and Ding Yousheng. 2014. “The Application of PLSA Features in the Automatic Assessment System for English Oral Test.” Computer Modelling and New Technologies 18: 414–18. http://www.cmnt.lv/en/on-line-journal/2014/2014-volume-18-12/part-c-operation-research-and-decision-making/the-application-of-plsa-features-in-the-automatic-assessment-system-for-english-oral-test.
Minister Faith Muthambi. 2017. SONA enables us to take part in our democracy.” 2017. https://www.gcis.gov.za/sona-enables-us-take-part-our-democracy.
Miranda, John Paul P., and Rex P. Bringula. 2021. Exploring Philippine Presidents’ speeches: A sentiment analysis and topic modeling approach.” Edited by John Kwame Boateng. Cogent Social Sciences 7 (1): 1932030. https://doi.org/10.1080/23311886.2021.1932030.
Rosen-Zvi, Michal, Thomas Griffiths, Mark Steyvers, and Padhraic Smyth. 2012. “The Author-Topic Model for Authors and Documents.” https://arxiv.org/abs/1207.4169.
Silge, Julia, and David Robinson. 2017. Text Mining with R: A Tidy Approach. 1st ed. O’Reilly Media, Inc.
Subhan, Subhan, M. Faris Al Hakim, Prasetyo Listiaji, and Wahyu Syafrizal. 2023. Modeling news topics on government youtube channels with latent Dirichlet allocation method.” AIP Conference Proceedings 2614 (1): 040009. https://doi.org/10.1063/5.0125954.
Zhang, Zhiyong. 2018. Text Mining for Social and Behavioral Research using R.” 2018. https://books.psychstat.org/textmining/index.html.
Zhu, Shaoping. 2014. “Pain Expression Recognition Based on pLSA Model.” The Scientific World Journal, 2356–6140. https://doi.org/10.1155/2014/736106.